import request from '@/utils/request';

/**
 * 获取友情链接
 * @returns {Promise<any>}
 */
export const getLinkData = async (data,page) => {
  const options = {
    params: data
  }
  return request(`/admin/links?page=` + page,options);
}
/**
 * 添加友情链接
 * @returns {Promise<any>}
 */
export const addLink = async (data) => {
  return request.post('/admin/links', {data});
}
/**
 * 更新友情链接
 * @returns {Promise<any>}
 */
export const editLink = async (link,data) => {
  return request.put(`/admin/links/${link}`, {data});
}
/**
 * 友情链接详情
 * @returns {Promise<any>}
 */
export const getLinkDetail = async (id) => {
  return request(`/admin/links/${id}`);
}
/**
 * 删除友情链接
 * @returns {Promise<any>}
 */
export const delLinkDetail = async (id) => {
  return request.delete(`/admin/links/${id}`);
}
/**
 * 删除友情链接
 * @returns {Promise<any>}
 */
export const editDisplay = async (id) => {
  return request.patch(`/admin/links/${id}/status`);
}

